import request from "@/utils/request";

const swap_WS = {
  ws: "/swap/swap-ws",

  pWs: "swap/positionVos",
  thumb: "/swap/pair/select",
  stompClient: "/topic/swap",
  plate: "/topic/swap/plate/",
  findKHistory: "/swap/kline/findKHistory",
  tickers: "/topic/swap/tickers/",
  trade: "/topic/swap/trade/",
  wallet: "/topic/new/swap/pair/wallet/",
  position: "/topic/new/swap/pair/position/",
  handlePushOrderEntrust: "/topic/new/swap/pair/handlePushOrderEntrust/",
  StopProfitAndStop: "/topic/new/swap/pair/StopProfitAndStop/",
};
const swap = {
  initUserSwap() {
    return request({
      url: "/swap/coin/initUserSwap",
      method: "get",
    });
  },
  volumeQuotation(params) {
    return request({
      url: "/swap/pair/volumeQuotation",
      method: "get",
      params,
    });
  },
  getSwapMenus(params) {
    return request({
      url: "/swap/pair/getSwapMenus",
      method: "get",
      params,
    });
  },
  getSwapMenusAll(params) {
    return request({
      url: "/swap/pair/getSwapMenusAll",
      method: "get",
      params,
    });
  },

  getMin(params) {
    return request({
      url: "/swap/pair/getMin",
      method: "get",
      params,
    });
  },
  swapCollectionList(params) {
    return request({
      url: "/swap/mUsers/swapCollectionList",
      method: "post",
      params,
    });
  },

  searchCollet(params) {
    return request({
      url: "/swap/pair/isCollection",
      method: "post",
      params,
    });
  },

  colletAdd(params) {
    return request({
      url: "/swap/collect/addOrDel",
      method: "get",
      params,
    });
  },
  getSwapWallet(params) {
    return request({
      url: "/swap/coin/getSwapWallet",
      method: "get",
    });
  },
  getSwapWalletLogs(params) {
    return request({
      url: "/swap/coin/logs",
      method: "post",
      data: params,
    });
  },
  thumb(params) {
    return request({
      url: "/swap/pair/select",
      method: "get",
      params,
    });
  },

  getLastTickers(data) {
    return request({
      url: `/swap/kline/getLastTickers`,
      params: data,
      method: "get",
    });
  },

  getOkxPlates(data) {
    return request({
      url: `/swap/kline/getOkxPlates`,
      params: data,
      method: "get",
    });
  },

  ChangePosition(data) {
    return request({
      url: `/swap/position/positionSwitching`,
      params: data,
      method: "get",
    });
  },

  getLeverage(data) {
    return request({
      url: `/swap/position/getLeverage`,
      params: data,
      method: "get",
    });
  },

  updateLeverage(data) {
    return request({
      url: `/swap/position/updateLeverage`,
      params: data,
      method: "get",
    });
  },

  OpenOrder(data) {
    return request({
      url: `/swap/swap/entrust/openOrder`,
      params: data,
      method: "get",
    });
  },

  historicalPosition(data) {
    return request({
      url: `/swap/swap/entrust/historicalPosition`,
      params: data,
      method: "get",
    });
  },

  flatMarket(data) {
    return request({
      url: `/swap/swap/entrust/flatMarket`,
      params: data,
      method: "get",
    });
  },

  SelQuantity(data) {
    return request({
      url: `/swap/position/Quantity`,
      params: data,
      method: "get",
    });
  },

  OneButtonFlat(data) {
    return request({
      url: `/swap/swap/entrust/OneButtonFlat`,
      params: data,
      method: "get",
    });
  },

  revocationOrder(data) {
    return request({
      url: `/swap/swap/entrust/revocationOrder`,
      params: data,
      method: "get",
    });
  },

  getUserLeverage(data) {
    return request({
      url: `/swap/position/getUserLeverage`,
      params: data,
      method: "get",
    });
  },
};

export { swap_WS, swap };
